package com.kitty.game.rank.model.record;

import lombok.Getter;
import lombok.Setter;

/**英雄会排行榜记录*/
@Setter
@Getter
public class YingXiongRankRecord extends RankRecord {
    private String gid;
    private String name;//角色名称
    private String partyName;//帮派名
    private int time;//时间
    private short level;//等级

    public YingXiongRankRecord() {}

    public YingXiongRankRecord(String gid, String name, String partyName, int time, short level) {
        this.gid = gid;
        this.name = name;
        this.partyName = partyName;
        this.time = time;
        this.level = level;
    }

    @Override
    public int compareTo(RankRecord o) {
        /**按单次英雄时间从大到小排序*/
        YingXiongRankRecord other = (YingXiongRankRecord)o;
        if (time != other.getTime()) {
            return time > other.getTime() ? -1 : 1;
        }

        /**道行一样时，就按gid排序吧，保证不是同一个玩家就好了*/
        return gid.compareTo(other.getGid());
    }
}
